#ifndef YOUTHMANAGER_H_
#define YOUTHMANAGER_H_

#include <QObject>
#include <QString>
#include <QList>
#include "Youth.h"
#include "RequirementsGroup.h"
#include <QDomNode>
#include "QuorumType.h"

class YouthManager;
typedef YouthManager* YouthManagerPtr;

class YouthManager : public QObject
{
    Q_OBJECT
    
public:
    static YouthManagerPtr getInstanceOf();    
	virtual ~YouthManager();
    
    YouthPtr findYouth(QString name);
    void LoadFromFile(QString datafile);
    void WriteToFile(QString datafile);
    void clear();
    
    QList<YouthPtr> quorum(QuorumType::Type theQuorum);

public slots:
    void newDeacon();
    void newTeacher();
    void newPriest();
    
signals:
    void youthListUpdated();
    
protected:
    YouthManager(QObject *parent = 0);
    
private:
    static YouthManagerPtr m_classPtr;
    QList<YouthPtr> m_youthList;
    
    void generateYouthForDebug();
    void LoadRequirements(RequirementsGroup* group, QDomNode node);
};

#endif /*YOUTHMANAGER_H_*/
